import request from "@/utils/request";
//获取角色列表
export function roleList(data) {
  return request({
    method: "post",
    url: "/waste/sysRole/getList",
    data
  });
}

//获取角色详情
export function roleDetails(_id) {
  return request({
    method: "get",
    url: `/waste/sysRole/getById/${_id}`
  });
}

//保存角色
export function roleSaveOrUpdate(data) {
  return request({
    method: "post",
    url: "/waste/sysRole/save",
    data
  });
}

//删除角色
export function roleDelete(id) {
  return request({
    method: "delete",
    url: `/waste/sysRole/remove/${id}`
  });
}

//获取用户列表
export function userList(data) {
  return request({
    method: "post",
    url: "/waste/sysUser/getList",
    data
  });
}

//保存用户
export function saveUser(data) {
  return request({
    method: "post",
    url: "/waste/sysUser/save",
    data
  });
}

//修改密码
export function modifyPassword(data) {
  return request({
    method: "post",
    url: "/waste/sysUser/modifyPassword",
    data
  });
}

//删除用户
export function deleteUser(_id) {
  return request({
    method: "delete",
    url: `/waste/sysUser/remove//${_id}`
  });
}

//获取菜单列表
export function menusList(data) {
  return request({
    method: "post",
    url: "/waste/sysMenu/getList",
    data
  });
}

//保存菜单
export function saveMenus(data) {
  return request({
    method: "post",
    url: "/waste/sysMenu/save",
    data
  });
}

//删除菜单
export function deleteMenus(_id) {
  return request({
    method: "delete",
    url: `/waste/sysMenu/remove/${_id}`
  });
}

//角色用户绑定
export function roleConcatUser(data) {
  return request({
    method: "post",
    url: "/waste/sysRole/concatUser",
    data
  });
}

//获取用户关联的角色列表信息
export function getListByUserId(userId) {
  return request({
    method: "get",
    url: `/waste/sysRole/getListByUserId/${userId}`
  });
}

//角色菜单绑定
export function concatMenu(data) {
  return request({
    method: "post",
    url: "/waste/sysRole/concatMenu",
    data
  });
}
//获得角色关联的菜单列表信息
export function getListByRoleId(roleId) {
  return request({
    method: "get",
    url: `/waste/sysMenu/getListByRoleId/${roleId}`
  });
}

//新手引导
export function updateGuide(data) {
  return request({
    method: "post",
    url: "/waste/sysUser/updateGuide",
    data
  });
}
